#include <climits>
#include <string>
using namespace std;
#include <vector>

class Solution
{
public:
    static int missingNumber(vector<int>& nums)
    {
        int num = 0;
        for(auto e : nums)
        {
            num ^= e;
        }
        for(int i=0; i<=nums.size(); i++)
        {
            num ^= i;
        }
        return num;
    }
};